GtkApplication: a new approach to accels
authorRyan Lortie <desrt@desrt.ca>
Wed, 10 Jul 2013 03:44:51 +0000 (23:44 -0400)
committerRyan Lortie <desrt@desrt.ca>
Tue, 15 Oct 2013 13:24:12 +0000 (09:24 -0400)
commit9a6ee36e9c5db83ce2e216a89706e547d73efd93
tree2249f17440f8a7efb7e519664dc42886fb602acb
parentafa8b0178fa57b49eb13aa4c4e3b460bcedcd9c9
GtkApplication: a new approach to accels

Rework how accels are handled on GtkApplicationWindow.

Instead of having GtkApplication fill the GtkAccelMap which is then used
by GtkApplicationWindow to create a GtkAccelGroup filled with closures
that is then associated with the window, do it directly.

GtkApplication now keeps a list of accels and their actions.
Accelerators on a GtkApplicationWindow ask GtkApplication to execute the
appropriate action.

This saves a fair bit of complexity and memory use (due to not having to
create all those closures and accelmap entries).  The new approach also
supports multiple accels per action (although there is not yet a public
API for it).

This patch (and the ones before) Reviewed and ACK'd by Matthias Clasen.
gtk/gtkapplication.c
gtk/gtkapplication.h
gtk/gtkapplicationprivate.h
gtk/gtkapplicationwindow.c
gtk/gtkwindow.c
gtk/gtkwindowprivate.h